using System.Reflection;
using Abp.Dependency;
using Abp.Modules;
using Abp.Reflection.Extensions;
using Abp.Timing;
using Vecen.BangChuang.Configuration;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;

namespace Vecen.BangChuang.Web.Host.Startup {

    /// <summary>
    /// 
    /// </summary>
    [DependsOn(typeof(BangChuangWebCoreModule))]
    public class BangChuangWebHostModule: AbpModule {
        private readonly IHostingEnvironment _env;
        private readonly IConfigurationRoot _appConfiguration;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="env"></param>
        public BangChuangWebHostModule(IHostingEnvironment env) {
            _env = env;
            _appConfiguration = env.GetAppConfiguration();
        }

        /// <summary>
        /// This method is used to register dependencies for this module.
        /// </summary>
        public override void Initialize() {
            IocManager.RegisterAssemblyByConvention(typeof(BangChuangWebHostModule).GetAssembly());
            IocManager.RegisterIfNot<IHttpContextAccessor, HttpContextAccessor>();
            Clock.Provider = ClockProviders.Local;
        }
    }
}